//package com.huc.tools.config.mq;
//
//import com.rabbitmq.client.Channel;
//import com.rabbitmq.client.Connection;
//import com.rabbitmq.client.ConnectionFactory;
//import com.rabbitmq.client.QueueingConsumer;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import java.io.IOException;
//import java.util.concurrent.TimeoutException;
//
///**
// * @Author: 胡成
// * @Version: 0.0.1V
// * @Date: 2018/8/13
// * @Description: 类描述
// **/
//@Configuration
//public class RabbitmqConfig {
//
//    private final static String QUEUE_NAME = "hello2";
//
//    /**
//     * @Author: 胡成
//     * @Date:   2018/8/13 16:30
//     * @Description: 创建通道
//    **/
//    @Bean
//    public Channel channel() throws IOException, TimeoutException {
//        /* 建立连接 */
//        ConnectionFactory factory = new ConnectionFactory();
//        // MQ的IP
//        factory.setHost("192.168.0.115");
//        // MQ端口
//        factory.setPort(5672);
//        // MQ用户名
//        factory.setUsername("guest");
//        // MQ密码
//        factory.setPassword("guest");
//        Connection connection = factory.newConnection();
//        Channel channel = connection.createChannel();
//		/* 声明要连接的队列 */
//        channel.queueDeclare(QUEUE_NAME, false, false, false, null);
//        System.out.println("等待消息产生：");
//        return channel;
//    }
//}
